package com.yonyou.cyxdms.sysAuth.service.service.impl;

import com.yonyou.cyxdms.framework.bean.dto.user_info.LoginInfoDto;
import com.yonyou.cyxdms.sysAuth.service.constants.UserAuthConstant;
import com.yonyou.cyxdms.sysAuth.service.service.UserAuthService;
import com.yonyou.cyxdms.sysAuth.service.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 定义GMMC 的用户认证信息
 *
 * @author: zhangxianchao
 * @since: 2018/9/22 0022
 * @updateDate:
 * @updateRemark:
 * @version:1.0 Copyright: Copyright (c) 2018
 */
@Service(UserAuthConstant.SERVICE_NAME_USER_AUTH + UserAuthConstant.APP_SOURCE_BEIJING)
@Transactional(rollbackFor = Exception.class)
public class BeiJingUserAuthServiceImpl implements UserAuthService {

    @Autowired
    UserService userService;

    /**
     * 根据主应用的用户信息获取自己应用的用户信息
     *
     * @param token 主应用的用户信息
     * @return org.springframework.http.ResponseEntity
     * @author zhangxianchao
     * @since 2018/9/22 0022
     */
    @Override
    @Transactional(readOnly = true)
    public LoginInfoDto getAppUserInfo(String token) {
        return userService.getAppUserInfo(UserAuthConstant.APP_SOURCE_BEIJING, token,null);
    }
}
